package cn.xnatural.demo.entity;

import cn.xnatural.jpa.LongIdEntity;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.Table;

@Entity
@DynamicUpdate
@Table(indexes = {
        @Index(name = "idx_name", columnList = "name", unique = true),
})
public class User extends LongIdEntity {
    /**
     * 用户登录名
     */
    @Column(nullable = false)
    private String name;
    /**
     * 登录的密码
     */
    @Column(nullable = false, length = 50)
    private String password;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
}
